package com.easy_buy.domain;

import lombok.Data;

import javax.persistence.*;

@Entity
@Data
public class Commodityimage {
    @Id
    private int pid;
    private byte[] image;
    //一对一关联关系只能保存在Commodityimage中，因为外键设在commodityimage表上
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "pid")
    @SuppressWarnings("all")
    private Commodity commodity;
}
